<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Cross-Compiling on GNU/Linux</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><meta name="keywords" content="Intellon, Atheros, Qualcomm, HomePlug, powerline, communications, INT6000, INT6300, INT6400, AR7400, AR7420"><link rel="home" href="index.html" title="Qualcomm Atheros Open Powerline Toolkit"><link rel="up" href="ch03.html" title="Chapter 3.  Software"><link rel="prev" href="ch03s05.html" title="Stand-alone Compiling on GNU/Linux"><link rel="next" href="ch03s07.html" title="Compilation with Visual Studio .NET 2003"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">
				Cross-Compiling on GNU/Linux
				</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch03s05.html">Prev</a> </td><th width="60%" align="center">Chapter 3. 
		Software 
		</th><td width="20%" align="right"> <a accesskey="n" href="ch03s07.html">Next</a></td></tr></table><hr></div><div class="section" title="Cross-Compiling on GNU/Linux"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="software-cross-compile"></a>
				Cross-Compiling on GNU/Linux
				</h2></div></div></div><p>
				Makefiles are setup for cross-compilation using custom toolchains. File <code class="filename">make.def</code>, in the main toolkit folder, defines cross-comilation symbols referenced in lower-level makefiles. Lower-level makefiles include <code class="filename">make.def</code> before building their targets. The following is an example <code class="filename">make.def</code> file used when cross-compiling for the ADM5120 MIPSEL-based gateway.
				</p><div class="example"><a name="idp20831144"></a><p class="title"><b>Example 3.3. 
					Cross-compiling with make.def
					</b></p><div class="example-contents"><pre class="programlisting">
# file: make.def

# ====================================================================
# Edimax Hardware;
# --------------------------------------------------------------------

PLATFORM=-D_ADM5120_
MODEL=-D_6104KP_
ENDIAN=-D_LITTLE_ENDIAN_
GATEWAY=y

# ====================================================================
# AMiLDA Software; uncomment these lines when cross-compiling;
# --------------------------------------------------------------------

# CROSS=/export/tools/mipsel-linux-uclibc/bin/mipsel-uclibc-
# CROSS_LINUX=/export/tools/bin/mipsel-linux-

# ====================================================================
# toolchain;
# --------------------------------------------------------------------

CC=$(CROSS)gcc
STRIP=$(CROSS)strip
LD=$(CROSS)ld
AR=$(CROSS)ar
RANLIB=$(CROSS)ranlib
CAS=$(CROSS)gcc -c
CPP=$(CROSS)gcc -E

# ====================================================================
# folders;
# --------------------------------------------------------------------

BIN=/usr/local/bin
MAN=/usr/share/man/man7
WWW=/home/www
DOC=/home/www/software/plc-utils/

# ====================================================================
# permissions;
# --------------------------------------------------------------------

OWNER=0
GROUP=0

</pre></div></div><br class="example-break"><p>
				Developers are encouraged to make changes in this file rather than adding additional variables to the lower-level makefiles. For example, you can edit variable <code class="varname">BIN</code> to install toolkit programs in some location other than <code class="filename">/usr/local/bin</code> or variable <code class="varname">WWW</code> to install <acronym class="acronym">HTML</acronym> documentation on your local website.
				</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch03s05.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch03.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch03s07.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">
				Stand-alone Compiling on GNU/Linux
				 </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 
				Compilation with Visual Studio .NET 2003
				</td></tr></table></div></body></html>
